/****************************************************
    Author:            龙之介
    CreatTime:    #CreatTime#
    Description:     Nothing
*****************************************************/
using UnityEngine.SceneManagement;
using UnityEngine;
using ZYKTool;
using LongZhiJie;
using HQL;

public class TapTapManger : MonoBehaviour
{
    #region 常量


    #endregion

    #region 事件
    #endregion

    #region 字段
    public bool ISTest = true;
    #endregion


    #region 属性 
    #endregion



    #region 方法 
    public void Init()
    {
        TapTapStaticValue._AudioSource = transform.GetOrAddComponent<AudioSource>();
        DontDestroyOnLoad(this);
       SceneManager.LoadScene(1);


    }
    protected void PlaySound(AudioSource _AudioSource)
    {
        string name = "射击BGM";

        AudioClip clip = Resources.Load<AudioClip>(name);
        _AudioSource.clip = clip;
        _AudioSource.PlayOneShot(clip);
    }

    public void InitGame()
    {
        Cursor.visible = false;
        transform.GetOrAddComponent<InitGameManger>().Init();
        transform.GetOrAddComponent<PlayerUpdateManger>().Init();
        transform.GetOrAddComponent<ZYKTool.Timer.ZYKTimerSystemTool>();
        //transform.GetOrAddComponent<ZYKObjectPoolTool>();
        GameObject TapTapUpManger = GameObject.Find("TapTapUpManger");
        if (TapTapUpManger != null)
        {
            TapTapStaticValue.TapTap升级系统=TapTapUpManger.transform.GetOrAddComponent<TapTap升级系统>();
            TapTapStaticValue.TapTap升级系统.Init();
        }
        TapTapStaticValue.UpdateRandom后座力=5f;
        TapTapStaticValue.UpdateRandom玩家攻击可以移动=false;
        TapTapStaticValue.UpdateRandom重力切换改为闪现 = false;
        TapTapStaticValue.TapTapModelManger = transform.GetOrAddComponent<TapTapModelManger>();
        TapTapStaticValue.TapTapModelManger.Init();
        //transform.GetOrAddComponent<CameraManger>().Init();
    }
    #endregion

    #region Unity回调
    private void Awake()
    {

    }
    private void Start()
    {
        Cursor.visible = false;

        if (ISTest)
        {
            InitGame();
            return;
        }
        Init();
    }
    #endregion

    #region 事件回调
    #endregion

    #region 帮助方法
    #endregion

}
